package com.knight.hadoop.day12.zuoye;

import org.apache.hadoop.io.Text;
import org.apache.hadoop.io.WritableComparable;
import org.apache.hadoop.io.WritableComparator;

public class LogPageViewsComparator extends WritableComparator{
	public LogPageViewsComparator() {
		super(LogBean2.class, true);
	}
	
	@Override
	public int compare(WritableComparable a, WritableComparable b) {
		LogBean2 aBean = (LogBean2) a;
		LogBean2 bBean = (LogBean2) b;
		Text ipText = new Text();
		ipText.set(aBean.getSessionId());
		Text ipText2 = new Text();
		ipText2.set(bBean.getSessionId());
		return ipText.compareTo(ipText2);
	}
	
}
